This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License (version 2) for more details.
You should have received a copy of the GNU General Public License (version 2)
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdlib.h>
#include "JACKaudiooutput.h"
Master *jackmaster;
jack_client_t *jackclient;
jack_port_t *outport_left,*outport_right;
int jackprocess(jack_nframes_t nframes,void *arg);
int jacksrate(jack_nframes_t nframes,void *arg);
void jackshutdown(void *arg);
bool JACKaudiooutputinit(Master *master_){
jackmaster=master_;
jackclient=0;
char tmpstr[100];
for (int i=0;i<15;i++){
if (i!=0) snprintf(tmpstr,100,"ZynAddSubFX_%d",i);
else snprintf(tmpstr,100,"ZynAddSubFX");
jackclient=jack_client_new(tmpstr);
if (jackclient!=0) break;
};
if (jackclient==0) {
fprintf(stderr,"\nERROR: Cannot make a jack client (possible reasons: JACK server is not running or jackd is launched by root and zynaddsubfx by another user.).\n");